<template>
    <!-- <v-breadcrumbs :items="items" divider=">"></v-breadcrumbs> -->
    <div class="r-page">
        <Baner></Baner>
        <div class="d-flex Energy_checkIn user-none">
            <Evergy></Evergy>
            <CheckIn></CheckIn>
            <CheckFans></CheckFans>
        </div>
        <div class="d-flex baner__">
            <Invite></Invite>
            <Gotten></Gotten>
        </div>
        <!-- <Rank></Rank> -->
        <Yanim></Yanim>
        <NameList></NameList>
    </div>
</template>

<script lang="ts" setup>
import NameList from "./baner/components/NameList.vue";
import { ref, reactive, onMounted } from "vue";
import { useRoute } from "vue-router";
import { useUser } from "@/stores/user";
import { useAccount } from "@/stores/account";
import Invite from "./invite/index.vue";
import Gotten from "./gotten/index.vue";
import Baner from "./baner/index.vue";
import Evergy from "./energy_checkIn/energy.vue";
import CheckIn from "./energy_checkIn/checkin.vue";
import CheckFans from "./energy_checkIn/check_fans.vue";
import i18n from "@/locals";
import { loginsuccall } from "./script/reward";
import { getDataS } from './script/reward';
import Yanim from '@/components/y-anim/index.vue';
import Share from "./share/index.vue";
import InCheck from "./check-in/index.vue";
import Day from "./day/index.vue";
import Rank from "./rank/index.vue";
import { get } from "@/comm/request";
import { URL_USER_INFO } from "@/comm/api";
import { check_fans } from "./energy_checkIn/script/check_fans";

const route = useRoute();
const user = useUser();
console.log(route, "---none");

onMounted(() => {
    console.log(route, "---ok");
    user.getMission();
    user.getClocked();
    loginsuccall();
    getDataS();
    // if (user.isLogin === false) {
    //     account.changePopLogin(true);
    // }

    // this.getChannelList();
    // this.getEnergyFlow();
    // user.getInvite();
    // user.getDaliyMission();去掉每日任务接口调用
    // await this.getVipList();
    // this.getSubscriberList();
    // user.getRankInvite();
    document.addEventListener("visibilitychange", async function () {
        console.log(document.visibilityState);
        if (document.visibilityState == 'visible') {
            let res: any = await get(URL_USER_INFO)
            check_fans.init()
        }

        // Modify behavior...
    });
});

const account = useAccount();

const myAccount = ref("1221223@google.com");

const onFacebook = () => {
    account.changePopBindFacebook(true);
};

const items = ref([
    {
        // title: "主頁",
        title: i18n.global.t("message.Global.Home"),
        disabled: false,
        href: "/"
    },
    {
        // title: "獎勵中心",
        title: i18n.global.t("message.Global.child.f"),
        disabled: true,
        href: ""
    }
]);
</script>

<style lang="less" scoped>
@import url("./index.less");
</style>
